import { WebGLCanvas } from "@nirvana/canvas";
import { Cube } from "@nirvana/core";

// 使用使用 Canvas
let canvas = document.getElementById("engine-nirvana");
const webCanvas = new WebGLCanvas(canvas, {});
const engine = webCanvas.engine;
const gl = engine.gl;

// const points = new Point(new Float32Array([]), gl);
const cube = new Cube(gl);

engine.update = (gl) => {
  // console.log('--');
  gl.clearColor(0.0, 0.0, 0.0, 1.0);
  // 用上面指定的颜色清除缓冲区
  gl.clear(gl.COLOR_BUFFER_BIT);

  cube.render();
};
